package com.base.starter.controller;

import com.base.common.result.ResultVo;
import com.base.common.result.Result;
import com.base.domain.moudles.entity.User;
import com.base.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhou minghao
 * @date 2024/4/22
 * @description
 */
@RequestMapping("/api/v1/sys/user")
@RestController
@Api(tags = "系统用户管理")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/login")
    @ApiOperation("登录")
    @RequiresPermissions(value = "sys:user:login")
    public ResultVo login(@RequestBody User user){
        return Result.success(userService.getUserById(user));
    }

}
